<include file="Public/head"/>
<body class="no-skin">
<include file="Public/header"/>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <include file="Public/sidebar"/>
    <div class="main-content">
        <div class="main-content-inner">
            <include file="Public/breadcrumbs" />
            <div class="page-content">

                <include file="Public/set"/>
                <div class="row">
                    <div class="row" id="order-summary-stats-panel">
                        <div class="col-md-3">
                            <div class="well">
                                <b>今日充值</b>
                                <div class="text-primary" style="font-size:32px;margin:5px 0">
                                    ¥<span data-bind="price: stats_today.paid_amount">0.00</span>
                                </div>

                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="well">
                                <b>昨日充值</b>
                                <div class="text-primary" style="font-size:32px;margin:5px 0">
                                    ¥<span data-bind="price: stats_yesterday.paid_amount">0.00</span>
                                </div>

                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="well">
                                <b>本月充值 (不含当日) </b>
                                <div class="text-primary" style="font-size:32px;margin:5px 0">
                                    ¥<span data-bind="price: stats_this_month.paid_amount">0.00</span>
                                </div>

                            </div>
                        </div>
                        <div class="col-md-3">
                            <div class="well">
                                <b>累计充值 (不含当日) </b>
                                <div class="text-primary" style="font-size:32px;margin:5px 0">
                                    ¥<span data-bind="price: stats_this_month.paid_amount">0.00</span>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="row" id="member-summary-stats-panel">
                        <div class="col-md-3">
                            <div class="well">
                                <b>今日新增</b>
                                <div class="text-primary" style="font-size:32px;margin:5px 0">
                                    <span data-bind="text: stats_yesterday.new_member_count">0</span>                                   
                                </div>                               
                            </div>
                        </div>

                        <div class="col-md-3">
                            <div class="well">
                                <b>昨日新增</b>
                                <div class="text-primary" style="font-size:32px;margin:5px 0">
                                    <span data-bind="text: stats_yesterday.new_member_count">0</span>                                   
                                </div>                               
                            </div>
                        </div>

                        <div class="col-md-3">
                            <div class="well">
                                <b>本月新增 (不含当日) <i class="fa fa-question-circle" title="不含当日，非实时，每天凌晨2:30左右更新"></i></b>
                                <div class="text-primary" style="font-size:32px;margin:5px 0">
                                    <span data-bind="text: stats_this_month.new_member_count">1</span>
                                    
                                </div>                                
                            </div>
                        </div>

                        <div class="col-md-3">
                            <div class="well">
                                <b>所有时间 <i class="fa fa-question-circle" title="不含当日，非实时，每天凌晨2:30左右更新"></i></b>
                                <div class="text-primary" style="font-size:32px;margin:5px 0">
                                    <span data-bind="text: stats_all_time.new_member_count">5</span>
                                    
                                </div>                                
                            </div>
                        </div>
                    </div>
                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
	<!-- 模态框（Modal） -->
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                    <div class="modal-content">
                            <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                                            &times;
                                    </button>
                                    <h4 class="modal-title" id="myModalLabel"></h4>
                            </div>
                            <div class="modal-body"></div>
                            <div class="modal-footer">
                                    <button type="button" class="btn btn-default" data-dismiss="modal">我知道了</button>
                                    
                            </div>
                    </div><!-- /.modal-content -->
            </div><!-- /.modal -->
	</div>
    <include file="Public/footer"/>

</div><!-- /.main-container -->

<include file="Public/footerjs"/>
<!-- inline scripts related to this page -->
<style>
   
    .pagination div  a, .pagination div .current{
    position: relative;
    float: left;
    padding: 6px 12px;
    margin-left: -1px;
    line-height: 1.42857143;
    color: #009688;
    text-decoration: none;
    background-color: #fff;
    border: 1px solid #ddd;
}

.pagination div .current{
    background:#009688;
    color:#FFF;
    border-color:#009688;
}
</style>
<script type="text/javascript">
    $(function () {

        $("#officialnews ul").html('<div class="ace-icon fa fa-spinner fa-spin orange"></div>');
        $.ajax({
            type: 'GET',
            url: '{$Think.CONFIG.NEWS_URL}?callback=?',
            success: function (data) {
                $("#officialnews ul").html("");
                $.each(data.news, function (i, news) {
                    $("#officialnews ul").append("<li>" + news.pre + "<a href=\"" + news.url + "\" title=\"" + news.title + "\" target=\"_blank\">" + news.title + "</a>" + news.time + "</li>");
                });
            },
            error: function () {
                $("#officialnews ul").html("服务器不可用，请稍后再试！");
            },
            dataType: 'json'
        });

        $("#update").click(function () {

            $("#upmsg").html("");
            $("#upmsg").addClass("ace-icon fa fa-refresh fa-spin blue");
            $.ajax({
                type: 'GET',
                url: '{$Think.CONFIG.UPDATE_URL}?v={$Think.CONFIG.Version}&callback=?',
                success: function (json) {
                    if (json.result == 'no') {
                        $("#upmsg").html("目前还没有适合您当前版本的更新！").removeClass();
                    } else if (json.result == 'yes') {
                        $("#upmsg").html("检查到新版本 " + json.ver + "，请前往“系统设置”->“<a  href=\"{:U('Update/update')}\">在线升级</a>”").removeClass();
                    }
                },
                error: function () {
                    $("#upmsg").html("悲剧了，网络故障，请稍后再试！").removeClass();
                },
                dataType: 'json'
            });

        });
    })
    $(function () {
        $(".btn-info.submit").click(function () {
            var content = $("#content").val();
            if (content == '') {
                bootbox.dialog({
                    title: '友情提示：',
                    message: "反馈内容必须填写。",
                    buttons: {
                        "success": {
                            "label": "确定",
                            "className": "btn-danger"
                        }
                    }
                });
                return;
            }

            $("#form").submit();
        });
		
		$.ajax({
                type: 'GET',
                url: '/user/Ammount/new_amount',
                success: function (json) {
                    if(json.data != 0){
						$("#myModal").modal({});
						$("#myModalLabel").text(json.title);
						$(".modal-body").html(json.content);
					}
                },
                dataType: 'json'
            });
    });


</script>
</body>
</html>
